﻿<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>jQuery子元素选择器示例</title>
        <script src="js/jquery-3.6.1.min.js"></script>
        <style>
            ul {
                width: 100px;
            }
        </style>
    </head>
    <body>
        <h3>jQuery子元素选择器示例</h3>
        <hr>
        <ul class="all">
            <li>第一章</li>
            <li>第二章</li>
            <ul>
                <li>2.1</li>
                <li>2.2</li>
            </ul>
            <li>第三章</li>
        </ul>
        <script>
            $(document).ready(function() {
                $("ul.all>li").css("border", "1px solid red");
            });
        </script>
    </body>
</html>

